package com.coolt.client.components;

import com.coolt.client.Labels;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class TopMenu extends Composite {

	private Labels labelsConstants;
	private Hyperlink linkTopMenuAbout = new Hyperlink("", "about");
	private Hyperlink linkTopMenuTerms = new Hyperlink("", "terms");
	private Hyperlink linkTopMenuHelp = new Hyperlink("", "help");
	private Hyperlink linkTopMenuSignin = new Hyperlink("", "signin");

	public TopMenu() {

		labelsConstants = GWT.create(Labels.class);

		HorizontalPanel hp = new HorizontalPanel();
		hp.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
		hp.setSpacing(3);

		linkTopMenuAbout.setText(labelsConstants.topMenuAbout().toLowerCase());
		linkTopMenuTerms.setText(labelsConstants.topMenuTerms().toLowerCase());
		linkTopMenuHelp.setText(labelsConstants.topMenuHelp().toLowerCase());
		linkTopMenuSignin
				.setText(labelsConstants.topMenuSignin().toLowerCase());

		hp.add(new Label("|"));
		hp.add(linkTopMenuAbout);
		hp.add(new Label("|"));
		hp.add(linkTopMenuTerms);
		hp.add(new Label("|"));
		hp.add(linkTopMenuHelp);
		hp.add(new Label("|"));
		hp.add(linkTopMenuSignin);
		hp.add(new Label("|"));

		// hp.setHorizontalAlignment(ALIGN_RIGHT);

		initWidget(hp);
		setStyleName("topmenu");

		linkTopMenuAbout.addClickListener(new ClickListener() {
			public void onClick(Widget sender) {
				// call show inicio
				Window.alert("teste");
			}
		});

	}
}
